package com.settlement.system.model.param;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.settlement.system.common.enums.RpaChargeTaskStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;

/**
 * FMS 收退，退款报表请求参数
 *
 * @author Ximi
 * @since 2020/08/12
 */
@Data
public class RpaChargeTaskGetApiRequestParams extends ApiParams {

    /**
     * 平台
     */
    @ApiModelProperty(value = "平台",required = true)
    @NotBlank(message = "平台不能为空")
    private String channelName;

    /**
     * 任务状态 任务状态: 0:未支付, 1:RPA充值成功, 2:RPA充值失败， 多个状态用逗号隔开
     */
    @ApiModelProperty(value = "任务状态",required = true,example = "0,2")
    @NotBlank(message = "任务状态不能为空")
    private String taskStatus;


    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间",required = true)
    @NotBlank(message = "创建时间不能为空")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private String createTime;

    @Override
    public String verifyBean(){

        if(taskStatus.contains(RpaChargeTaskStatusEnum.RPA_RECHARGE_SUCCESS.getNo())){
            return "taskStatus 字段的值只能有0或2";
        }
        return null;
    }
}
